﻿/* 窗体边框阴影类
 */

/*待测试*/
namespace LSLib.Windows.Forms
{
    using System;
    using System.Runtime.InteropServices;

    public class Shadow
    {
        /// <summary>初始化：窗体阴影效果
        /// </summary>
        public static void InitWinShadow(IntPtr hwnd)
        {
            HandleRef handleRef = new HandleRef(null, hwnd);//此处用null是否可行：有待验证

            IntPtr getClassLong = API.Window.GetClassLongPtr(handleRef, (int)API.Window.ClassLongFlags.GCL_STYLE);

            API.Window.SetClassLongPtr(
                handleRef,
                (int)API.Window.ClassLongFlags.GCL_STYLE,
                (IntPtr)((int)getClassLong | API.ClassStyles.CS_DROPSHADOW));
        }
    }
}
